// 方法1
 
var n1 = process.argv[2];
var op = process.argv[3];
var n2 = process.argv[4];
var exit = n1+op+n2;
if(typeof(exit)=='undefined' || exit =='--help' ||exit=="-h") {
    console.log("请输入一个数学表达式,每个字符之间用空格隔开");    
}
else if(n1>='a'&&n1<='z' || n1>='A'&&n1<='Z' || n2>='A'&&n2<='Z'|| n2>='a'&&n2<='z' || op!='+' && op!='-' && op!='*' && op!='/' ){
    console.log("不是数学表达式");
}
else {
    console.log(eval(exit));
}


// 方法2
/* 
var arg = process.argv[2];
if((typeof arg) == 'undefined') {
    console.log("please innut arg!");
}
else if (arg == '--help') {
    console.log("please innut arg!");
}

var result = eval(arg);
if(!isNaN(parseInt(result))) { 
    //isNaN() 函数用于检查其参数是否是非数字值
    console.log(arg + "=" +result);
}

*/